package com.yphone.ui.login.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;

import com.zzkj.yunphone.R;
import com.yphone.tools.ToastUtil;

public class TelView extends EditText {
    public TelView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        setInputType(2);
    }

    public TelView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setInputType(2);
    }

    public TelView(Context context) {
        super(context);
        setInputType(2);
    }

    public String getTel(boolean isCheck) {
        String name = getText().toString().trim();
        if (!isCheck || !name.equals("")) {
            return name;
        }
        ToastUtil.showMidToast(getContext(), getResources().getString(R.string.login_phone_empty));
        return "";
    }
}